package myJs.user.mission

import myJs.Implicits._
import myJs.Utils._

import scala.scalajs.js.Dynamic.{global => g}
import myJs.myPkg.bootstrap.Bootstrap.default._
import myJs.myPkg.jquery._
import myJs.myPkg.{LayerOptions, MiniColorsOptions}
import myJs.projectCps._
import myJs.tool.Tool
import org.scalajs.dom.ext.Ajax
import org.scalajs.dom.{Element, document}
import scalatags.Text.all._
import org.scalajs.macrotaskexecutor.MacrotaskExecutor.Implicits._

import scala.scalajs.js
import scala.scalajs.js.annotation.{JSExport, JSExportTopLevel}
import scala.scalajs.js.{Date, UndefOr}
import scala.scalajs.js.JSConverters._


/**
 * Created by yz on 2019/4/25
 */
@JSExportTopLevel("DiffAnaMulResult")
object DiffAnaMulResult extends MissionResult {

  val scoreTabId = "score"

  @JSExport("init")
  def init = {
    refreshMissionInfo(getMissionId)
    refreshFileInfo(getMissionId)
    registerEvent

    selfInit
    zScorePlot.Cp.Props().render.renderIntoDOM(document.querySelector("#zScore #root"))
  }

  def selectTab(tabId: String) = {
    $("#myUl>li").removeClass("active")
    $(s"#myUl #${tabId}Li").addClass("active")
    $("#myTabContent .tab-pane").removeClass("active in")
    $(s"#myTabContent #${tabId}").addClass("active in")
  }

  def selfInit = {
    Tool.initMiniColors

  }

  def getMissionId = {
    g.missionId.toString
  }

}
